package cn.ylz.ylmall.content.dao.persist.repository;


import cn.ylz.ylmall.account.pojo.vo.PageData;
import cn.ylz.ylmall.content.pojo.entity.Content;
import cn.ylz.ylmall.content.pojo.param.ContentAddNewParam;
import cn.ylz.ylmall.content.pojo.vo.ContentListItemVO;
import cn.ylz.ylmall.content.pojo.vo.ContentStandardVO;
import cn.ylz.ylmall.content.pojo.vo.CountVO;
import org.springframework.stereotype.Repository;


public interface IContentRepository {
    /**
     * 插入content数据
     *
     * @param content
     * @return
     */
    int insert(Content content);

    /**
     * 按内容id删除
     *
     * @param id
     * @return
     */
    int deleteById(Long id);

    /**
     * 按id查询详情
     *
     * @param id
     * @return
     */
    ContentStandardVO getStandardById(Long id);

    PageData<ContentListItemVO> list(Integer pageNum, Integer defaultQueryPageSize);

    PageData<ContentListItemVO> listByCategoryId(Long categoryId, Integer pageNum, Integer defaultQueryPageSize);

    int updateViewCount(Long id);

    void update(Long id, Long likeCount, Long commentCount, Long collectCount);

    int updateContent(Long id,ContentAddNewParam contentAddNewParam);

}


